<!DOCTYPE html>
<html>
<head>
    <title>设备类型</title>
    #parse("/sys/header.html")
    <style>
        .ui-jqgrid {
            width: 100%;
            float: right;
        }
        .sugon_upload_btn {
            display: -webkit-inline-box;
            display: inline-block;
        }
        .leftHeight{
            height: 85vh;
            overflow: auto;
        }
        ::-webkit-scrollbar{
            width: 10px;
            height: 10px;
        }
        ::-webkit-scrollbar-thumb{
            border-radius: 10px;
            -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
            background: #a8a5a5;
        }
        .workShops{
            position: absolute;
            top: 0;
            width: 100%;
            height: 25px;
            background-color: white;
        }
    </style>
</head>
<body>
<div id="rrapp" v-cloak>
	<div v-show="showList">
        <Row :gutter="16" style="margin: 8px 0px 0px 1px">
            <div class="search-group">
                <i-col span="4">
                    <i-input v-model="q.name" @on-enter="query" placeholder="类型名称"></i-input>
                </i-col>
                <i-col span="4">
                    <i-input v-model="q.code" @on-enter="query" placeholder="类型编码"></i-input>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
        </Row>
        <Row :gutter="16" style="margin: 3px 0px 0px 0px;">
            <div class="buttons-group">
                #if($shiro.hasPermission("devtype:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("devtype:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("devtype:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>

        <Row  :gutter="16" style="margin: 8px 0px 0px 1px;">
            <i-col :xs="3" :sm="3" :md="3" :lg="3">
                <div class="leftHeight" >
                    <div class="workShops">
                        <p class="text-center" style="font-size: 15px;">设备类型</p>
                    </div>
                    <div id="storeLayer" style="margin-top: 25px">
                        <ul id="devTypeTree" class="ztree"></ul>
                    </div>
                </div>
            </i-col>
            <i-col :xs="21" :sm="21" :md="21" :lg="21">
                <table  id="jqGrid"></table>
            </i-col>
        </Row>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
		<i-form ref="formValidate" :model="devType" :rules="ruleValidate" :label-width="80">
            <Form-item label="类型编码" prop="typeCode">
                <i-input v-model="devType.typeCode" placeholder="类型编码"></i-input>
            </Form-item>
            <Form-item label="类型名称" prop="typeName">
                <i-input v-model="devType.typeName" placeholder="类型名称"></i-input>
            </Form-item>
            <Form-item label="上级类型" prop="typePid">
                <i-input v-model="devType.typePid" placeholder="上级类型"></i-input>
            </Form-item>
            <Form-item label="类型标志" prop="typeTp">
                <i-select v-model="devType.typeTp" placeholder="类型标志">
                    <i-option v-for="item in showDevTP" :value="item.value" :key="item.value">{{item.name}}
                    </i-option>
                </i-select>
            </Form-item>
            <Form-item label="备注" prop="remark">
                <i-input v-model="devType.remark" placeholder="备注"></i-input>
            </Form-item>

            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"></i-input>返回</i-button>
                <i-button type="info" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
	</Card>
</div>

<script src="${rc.contextPath}/js/device/devtype.js?_${date.systemTime}"></script>
</body>
</html>
